/*
 * @Author: 李天惊 uf_lee@163.com
 * @Date: 2022-11-21 13:09:19
 * @LastEditors: 李小晴 2689279066@qq.com
 * @LastEditTime: 2023-10-11 10:51:22
 * @FilePath: \zhmc\pc\sys\src\api\sys\knowledge\index.ts
 * Copyright (c) 2022 by 李天惊 uf_lee@163.com, All Rights Reserved.
 */
import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 列表
export const sysCrontabListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysCrontabList',
      data: data
    }
  })
}

// 修改
export const sysCrontabEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysCrontabEdit',
      data: data
    }
  })
}

// 新增
export const sysCrontabAddApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysCrontabAdd',
      data: data
    }
  })
}

// 删除
export const sysCrontabDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysCrontabDel',
      data: data
    }
  })
}

// 查看
export const sysCrontabSeeApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysCrontabSee',
      data: data
    }
  })
}

// 执行
export const sysCrontabExecuteApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysCrontabExecute',
      data: data
    }
  })
}
